<?php
namespace app\admin\models;

use think\Model;
use app\admin\model\User;
use app\admin\model\House;

class Yuyue extends Model{
	
	protected $table = "house_yuyue";
	protected $pk = 'id';
	public function user(){
		return	$this->hasOne('user','id','u_id');
	}
	public function house(){
		return	$this->hasOne('House','id','f_id');
	}
	public function list(){
		$list = self::with('user,house,house.loudong')->select();
		return $list;
	}
	public function chuli($id){
		$list = self::save(['state'=>"已处理"],['id'=>$id]);
		return $list;
	}
	public function shanchu($id){
		$list = self::where('id',$id)->delete();
		return $list;
	}
}
